/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package tracker.android.nativelib.impl;

import ecore.EcorePackage;

import ecore.impl.EcorePackageImpl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;

import org.eclipse.emf.ecore.impl.EPackageImpl;

import tracker.android.com.ComPackage;

import tracker.android.com.impl.ComPackageImpl;

import tracker.android.nativelib.BluetoothAdaptor;
import tracker.android.nativelib.BluetoothSocket;
import tracker.android.nativelib.Context;
import tracker.android.nativelib.Handler;
import tracker.android.nativelib.NativelibFactory;
import tracker.android.nativelib.NativelibPackage;

import tracker.android.sens.SensPackage;

import tracker.android.sens.impl.SensPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class NativelibPackageImpl extends EPackageImpl implements NativelibPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass contextEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass handlerEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass bluetoothSocketEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass bluetoothAdaptorEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see tracker.android.nativelib.NativelibPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private NativelibPackageImpl() {
		super(eNS_URI, NativelibFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link NativelibPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static NativelibPackage init() {
		if (isInited) return (NativelibPackage)EPackage.Registry.INSTANCE.getEPackage(NativelibPackage.eNS_URI);

		// Obtain or create and register package
		NativelibPackageImpl theNativelibPackage = (NativelibPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof NativelibPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new NativelibPackageImpl());

		isInited = true;

		// Obtain or create and register interdependencies
		ComPackageImpl theComPackage = (ComPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ComPackage.eNS_URI) instanceof ComPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ComPackage.eNS_URI) : ComPackage.eINSTANCE);
		SensPackageImpl theSensPackage = (SensPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(SensPackage.eNS_URI) instanceof SensPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(SensPackage.eNS_URI) : SensPackage.eINSTANCE);
		tracker.pc.com.impl.ComPackageImpl theComPackage_1 = (tracker.pc.com.impl.ComPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(tracker.pc.com.ComPackage.eNS_URI) instanceof tracker.pc.com.impl.ComPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(tracker.pc.com.ComPackage.eNS_URI) : tracker.pc.com.ComPackage.eINSTANCE);
		EcorePackageImpl theEcorePackage = (EcorePackageImpl)(EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI) instanceof EcorePackageImpl ? EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI) : EcorePackage.eINSTANCE);

		// Create package meta-data objects
		theNativelibPackage.createPackageContents();
		theComPackage.createPackageContents();
		theSensPackage.createPackageContents();
		theComPackage_1.createPackageContents();
		theEcorePackage.createPackageContents();

		// Initialize created meta-data
		theNativelibPackage.initializePackageContents();
		theComPackage.initializePackageContents();
		theSensPackage.initializePackageContents();
		theComPackage_1.initializePackageContents();
		theEcorePackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theNativelibPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(NativelibPackage.eNS_URI, theNativelibPackage);
		return theNativelibPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getContext() {
		return contextEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getHandler() {
		return handlerEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getBluetoothSocket() {
		return bluetoothSocketEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getBluetoothAdaptor() {
		return bluetoothAdaptorEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NativelibFactory getNativelibFactory() {
		return (NativelibFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		contextEClass = createEClass(CONTEXT);

		handlerEClass = createEClass(HANDLER);

		bluetoothSocketEClass = createEClass(BLUETOOTH_SOCKET);

		bluetoothAdaptorEClass = createEClass(BLUETOOTH_ADAPTOR);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes

		// Initialize classes and features; add operations and parameters
		initEClass(contextEClass, Context.class, "Context", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(handlerEClass, Handler.class, "Handler", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(bluetoothSocketEClass, BluetoothSocket.class, "BluetoothSocket", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(bluetoothAdaptorEClass, BluetoothAdaptor.class, "BluetoothAdaptor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		// Create resource
		createResource(eNS_URI);
	}

} //NativelibPackageImpl
